<template>
	<view>
		<view class="top-bg">
			<text>CONTRA</text>
		</view>
		<view class="info-con">
			<view class="info">
				<view class="name">
					<view>
						<text>会员姓名：</text>
						<text>小草莓</text>
					</view>
					<view>
						<text>会员手机：</text>
						<text>158****8888</text>
					</view>
				</view>
			</view>
		</view>
		<!-- 进度记录 -->
		<view class="contract">
			<view style="height: 76rpx;">
				<view class="title">
					<view class="contract-title">进度记录</view>
					<view class="yellow-line"></view>
				</view>
			</view>
		</view>
		<view class="main">
			<GymProgress :isActive='isActive'></GymProgress>
		</view>
		<!-- 评价结果 -->
		<view class="contract" style="padding-top: 0;">
			<view style="height: 76rpx;">
				<view class="title">
					<view class="contract-title">评价结果</view>
					<view class="yellow-line"></view>
				</view>
			</view>
		</view>
		<view class="main" style="margin-bottom: 100rpx;padding-bottom: 23rpx;">
			<view class="rate">
				<view v-for="(item, index) in rates" :key="index">
					<text class="name">{{ item.name }}</text>
					<view class="score">
						<GymRate :value="item.comm" :margin="'2px'" :disabled='true'></GymRate>
						<text v-show="item.comm <= 2">一般</text>
						<text v-show="item.comm >= 3 && item.comm <= 4 ">满意</text>
						<text v-show="item.comm == 5">超棒</text>
					</view>
				</view>
			</view>
			<view class="comment">
				<text>你是最棒的</text>
			</view>
		</view>
	</view>
</template>

<script>
	import GymProgress from '../../components/progress.vue'
	import GymRate from '../../components/rate/d-rate/index.vue'
	export default {
		data() {
			return {
				starVal: 0,
				isActive: 3,
				rates: [
					{
						id: 1,
						name: '课程顾问GB  AMILY',
						comm: 1
					},
					{
						id: 2,
						name: '课程顾问GB  AMILY',
						comm: 3
					},
					{
						id: 3,
						name: '课程顾问GB  AMILY',
						comm: 5
					}
				]
			}
		},
		onLoad() {
			
		},
		components: {
			GymProgress,
			GymRate
		},
		methods: {
			// 星星的值
			changeStar(e) {
				console.log(e)
				this.star = e - 0
			},
			currentItem(e) {
				console.log(e)
				e.comm = this.star
				console.log(this.rates)
			}
		}
	}
</script>

<style lang="scss">
	.top-bg {
		height: 200rpx;
		background-color: #fedb0d;
		text-align: center;
		text {
			font-size: 152rpx;
			font-weight: 800;
			color: rgba(255, 255, 255, .2);
		}
	}
	.info-con {
		font-family: PingFangSC-Regular;
		// height: 250rpx;
		position: relative;
		.info {
			position: absolute;
			left: 50%;
			top: -100rpx;
			transform: translateX(-50%);
			.title {
				font-size: 38rpx;
				color: #191919;
				font-weight: 600;
				padding: 0 0 20rpx 26rpx;
			}
			.name {
				width: 690rpx;
				// height: 400rpx;
				background-color: #fff;
				box-shadow: 0 8rpx 68rpx 0 rgba(0, 0, 0, 0.1);
				border-radius: 2rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				view {
					box-sizing: border-box;
					font-size: 30rpx;
					padding: 16rpx 40rpx;
					display: flex;
					text:nth-child(2) {
						padding-left: 6rpx;
					}
				}
				view:nth-child(1) {
					padding-top: 32rpx;
				}
				view:last-child {
					padding-bottom: 32rpx;
				}
			}
		}
	}
	.contract {
		padding-top: 77rpx;
		margin-top: 45rpx;
		.title {
			margin-left: 50rpx;
			font-family: PingFangSC-Semibold;
			font-size: 38rpx;
			font-weight: 600;
			color: #191919;
			position: relative;
			.yellow-line {
				width: 168rpx;
				height: 14rpx;
				background-color: #fedb0d;
				position: absolute;
				left: -6rpx;
				bottom: -52rpx;
			}
			.contract-title {
				position: absolute;
				left: 0;
				top: 0;
				z-index: 2;
			}
		}
	}
	.main {
		margin: 0 auto;
		width: 690rpx;
		// height: 530rpx;
		background-color: #fff;
		box-shadow: 0 8rpx 68rpx 0 rgba(0, 0, 0, 0.1);
		border-radius: 2rpx;
	}
	.rate {
		display: flex;
		flex-direction: column;
		padding: 30rpx 20rpx 30rpx 0rpx;
		view {
			display: flex;
			height: 76rpx;
			align-items: center;
			text {
				font-family: PingFangSC-Regular;
				font-size: 26rpx;
				color: #7e7e7e;
				padding-left: 16rpx;
			}
		}
		.name {
			font-family: PingFangSC-Medium;
			font-size: 30rpx;
			color: #000;
			display: flex;
			flex: 1;
		}
	}
	.comment {
		box-sizing: border-box;
		margin: 0 20rpx;
		// padding-bottom: 20rpx;
		padding: 30rpx;
		height: 210rpx;
		background-color: #fffbe6;
		border-radius: 2rpx;
		text {
			font-family: PingFangSC-Regular;
			font-size: 30rpx;
		}
	}
</style>
